﻿using uTILLIty.Rave.Contract.StorageAdapter;

namespace uTILLIty.Rave.Core.StorageAdapter
{
	/// <summary>
	/// A uniform way of identifying LDAP user-entities
	/// </summary>
	/// <remarks>
	/// Use <see cref="StorageMemberExtensions.LdapInfo"/> to access an set the 
	/// <see cref="StorageMember.TargetMember"/>
	/// </remarks>
	public class ActiveDirectoryMemberInformation
	{
		/// <summary>
		/// Initializes a new instance of an <see cref="ActiveDirectoryMemberInformation"/> object
		/// </summary>
		/// <param name="sid"><see cref="Sid"/></param>
		/// <param name="distinguishedName"><see cref="DistinguishedName"/></param>
		public ActiveDirectoryMemberInformation(string sid, string distinguishedName)
		{
			Sid = sid;
			DistinguishedName = distinguishedName;
		}
		// ReSharper restore CSharpWarnings::CS1591

		/// <summary>
		/// The unique Security-Identifier of the member within AD
		/// </summary>
		public string Sid { get; set; }

		/// <summary>
		/// The DN (or fallback, the SID) of the member within AD
		/// </summary>
		public string DistinguishedName { get; set; }

		/// <summary>
		/// Returns a <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
		/// </summary>
		/// <returns>
		/// A <see cref="T:System.String"/> that represents the current <see cref="T:System.Object"/>.
		/// </returns>
		/// <filterpriority>2</filterpriority>
		public override string ToString()
		{
			return string.Format("{0}", DistinguishedName);
		}
	}
}